/**
 *	@file	an_puzzle_def.h
 *	@brief	アンノーンパズル　リテラル定義
 *	@author	Miyuki Iwasawa
 *	@date	08.05.28
 */

#ifndef __H_AN_PUZZLE_DEF_H__
#define __H_AN_PUZZLE_DEF_H__

///フレーム定義
#define UFRM_MSG	(GF_BGL_FRAME0_S)
#define UFRM_STONE	(GF_BGL_FRAME2_S)
#define UFRM_BACK	(GF_BGL_FRAME3_S)

#define UFRM_MSG_PRI	(1)
#define UFRM_STONE_PRI	(2)
#define UFRM_BACK_PRI	(3)

#define DFRM_MSG	(GF_BGL_FRAME0_M)
#define DFRM_EFF	(GF_BGL_FRAME2_M)
#define DFRM_BACK	(GF_BGL_FRAME3_M)

#define DFRM_MSG_PRI	(0)
#define DFRM_EFF_PRI	(2)
#define DFRM_BACK_PRI	(3)

//=======================================
///アルファ値設定
//=======================================
#define ALPHA_SECOND	(26)
#define ALPHA_FIRST		(6)

#define ALPHA_MASK_1ST	(GX_BLEND_PLANEMASK_NONE)
#define ALPHA_MASK_2ND	(GX_BLEND_PLANEMASK_BG2|GX_BLEND_PLANEMASK_BG3|GX_BLEND_PLANEMASK_OBJ)

///シーケンス定義
typedef enum{
 SEQ_FADE_IN,
 SEQ_PUZZLE_MAIN,
 SEQ_MOVE_CHECK,
 SEQ_MOVE,
 SEQ_ROT_EFF,
 SEQ_END_CHECK,
 SEQ_PERFECT,
 SEQ_FADE_OUT,
 SEQ_EXIT,
}ALBUM_SEQ;

typedef enum{
 STATE_SELECT,
 STATE_TURN,
 STATE_DRUG,
}PANEL_STATE;

///キーチェック
#define CHK_KTST_KEY_SELECT	(PAD_BUTTON_DECIDE|PAD_BUTTON_CANCEL|PAD_KEY_UP|PAD_KEY_DOWN|PAD_KEY_LEFT|PAD_KEY_RIGHT)

///SE
#define	AN_PUZZLE_SE_DECIDE	( SEQ_SE_DP_SELECT )	//
#define	AN_PUZZLE_SE_PAGE	( SEQ_SE_DP_MEKURU3 )	//

///メッセージIDX定義
enum{
 MIDX_POKE_LV01,
 MIDX_POKE_LV02,
 MIDX_POKE_LV03,
 MIDX_POKE_LV04,
 MIDX_POKE_MAX,
};
enum{
 MIDX_EXP_ENDCHK,
 MIDX_EXP_MAX,
};

#define WORDSET_AN_PUZZLE_BUFLEN	(16)
#define WORDSET_AN_PUZZLE_BUFNUM	(6)
#define AN_PUZZLE_MSG_BUFLEN		(128)	///<メッセージ展開バッファ長

//////////////////////////////////////////////////////
//グリッドフィールド関連
#define ROT90	(16384)

enum{
 ROT_U = 0,
 ROT_R,
 ROT_D,
 ROT_L,
};

#define PANEL_COMP_FLDX	(4)

#define PANEL_FLDX	(6)
#define PANEL_FLDY	(6)
#define PANEL_MAX	(16)

#define GRID_BG_PX	(4)
#define GRID_BG_PY	(0)
#define GRID_BG_W	(4)
#define GRID_BG_H	(4)

enum{
 G_NULL,
 G_MOVE,
 G_TARGET,
 G_CONF,
};

///////////////////////////////////////////
//アクター関連
#define AN_PUZZLE_ACTRES_MAX	(5)	///<リソース数
#define AN_PUZZLE_ACTPAL_NUM	(3)	///<管理パレット数

enum{
 ACT_RET,
 ACT_SHADOW,
 ACT_PANEL01,
 ACT_PANEL16 = ACT_PANEL01+15,
 AN_PUZZLE_ACTMAX,
};

enum{
 ACTRES_NORMAL,
 ACTRES_PUZZLE01,
 ACTRES_PUZZLE02,
 ACTRES_PUZZLE03,
 ACTRES_PUZZLE04,
};

enum{
 ANM_RET,
 ANM_RETA,
 ANM_RETP,
 ANM_SHADOW,
};

enum{
 ACT_SPRI_TARGET,
 ACT_SPRI_SHADOW,
 ACT_SPRI_PANEL,
 ACT_SPRI_RET,
};

#define ACT_RET_PX	(26*8)
#define ACT_RET_PY	(21*8)

#define ACT_PANEL_PX	(6*8)
#define ACT_PANEL_PY	(2*8)
#define ACT_PANEL_OX	(4*8)
#define ACT_PANEL_OY	(4*8)
#define ACT_PANEL_W		(32)
#define ACT_PANEL_H		(32)

#define ACT_PANEL_OFS	(-2)

#define ACT_PANEL_LU	(ACT_PANEL_H/2)
#define ACT_PANEL_LD	(192-(ACT_PANEL_H/2))
#define ACT_PANEL_LL	((4*8)+ACT_PANEL_W/2)
#define ACT_PANEL_LR	((28*8)-(ACT_PANEL_W/2))

#define TARGET_NULL		(0xFF)

///////////////////////////////////////////
///パレット定義
#define AN_PUZZLE_BG_PALMAX	(8)
#define AN_PUZZLE_OBJ_PALMAX	(8)

#define MSG_FONT_PAL	(3)
//ここまでnclの中
///////////////////////////////////
#define TALK_FONT_PAL		(4)
#define BMP_TALK_WIN_PAL	(5)
#define YESNO_WIN_PAL		(6)	//2本占有

#define	FCOL_W_BLACK ( GF_PRINTCOLOR_MAKE( FBMP_COL_BLACK, FBMP_COL_BLK_SDW, FBMP_COL_WHITE ) )		// フォントカラー：黒
#define	FCOL_N_BLACK ( GF_PRINTCOLOR_MAKE( 3, 2, FBMP_COL_NULL ) )		// フォントカラー：黒
#define	FCOL_N_POKE	( GF_PRINTCOLOR_MAKE( 2, 1, FBMP_COL_NULL ) )		// フォントカラー：こげ茶

///////////////////////////////////////////
///BMPウィンドウ定義

enum{
 WIN_RET,
 WIN_MSG,
 WIN_POKE,
 WIN_MAX,
};

///ウィンドウ関連キャラ領域指定(上下共用)
#define BMP_TALK_WIN_CGX	(1)

/////////////////////////////////////////////
//下画面用

//はい・いいえメニュー領域
#define	BMP_YESNO_PX	( 25 )
#define	BMP_YESNO_PY	( 10 )
#define BMP_YESNO_FRM	( DFRM_MSG )
#define	BMP_YESNO_PAL	( YESNO_WIN_PAL )
#define BMP_YESNO_CGX_SIZ	(TOUCH_SW_USE_CHAR_NUM)
#define	BMP_YESNO_CGX	( BMP_TALK_WIN_CGX+TALK_WIN_CGX_SIZ )

//メッセージ領域
#define	BMP_MSG_PX	( 2 )
#define	BMP_MSG_PY	( 19 )
#define	BMP_MSG_SX	( 27 )
#define	BMP_MSG_SY	( 4 )
#define BMP_MSG_FRM	( DFRM_MSG )
#define	BMP_MSG_PAL	( TALK_FONT_PAL )
#define BMP_MSG_CGX_SIZ	(BMP_MSG_SX*BMP_MSG_SY)
#define	BMP_MSG_CGX	( BMP_YESNO_CGX+BMP_YESNO_CGX_SIZ )

///やめるボタン
#define	BMP_BACK_PX	( 26 )
#define	BMP_BACK_PY	( 21 )
#define	BMP_BACK_SX	( 6 )
#define	BMP_BACK_SY	( 3 )
#define BMP_BACK_FRM	( DFRM_EFF )
#define	BMP_BACK_PAL	( MSG_FONT_PAL )
#define BMP_BACK_CGX_SIZ	(BMP_BACK_SX*BMP_BACK_SY)
#define	BMP_BACK_CGX	( 1024-BMP_BACK_CGX_SIZ )

///////////////////////////////////////////
//上画面用
#define	BMP_POKE_PX	( 4 )
#define	BMP_POKE_PY	( 15 )
#define	BMP_POKE_SX	( 24 )
#define	BMP_POKE_SY	( 6 )
#define BMP_POKE_FRM	( UFRM_MSG )
#define	BMP_POKE_PAL	( MSG_FONT_PAL )
#define BMP_POKE_CGX_SIZ	(BMP_POKE_SX*BMP_POKE_SY)
#define	BMP_POKE_CGX	( 1 )

///////////////////////////////////////////////
///タッチパネル定義
#define TP_BACK_PX		(26*8+1)
#define TP_BACK_PY		(21*8+1)
#define TP_BACK_W		(48-2)
#define TP_BACK_H		(24-2)

#define TP_PANEL_W		(32)
#define TP_PANEL_H		(32)
#define TP_PANEL_SX		(32)
#define TP_PANEL_EX		(28*8)

#endif	//__H_AN_PUZZLE_DEF_H__
